package mysql;
import java.sql.*;
public class Create {
		static String creatsql =  "CREATE TABLE time("
	            + "id int(10) PRIMARY KEY not null,"
	            + "ss int(10) not null"
	            + ")charset=utf8;";
		public static void main(String[] args)
		{
		     try {
		          Class.forName("com.mysql.cj.jdbc.Driver");     //加载MYSQL JDBC驱动程序   
		          //Class.forName("org.gjt.mm.mysql.Driver");
		         System.out.println("Success loading Mysql Driver!");
		        }
		        catch (Exception e) {
		          System.out.print("Error loading Mysql Driver!");
		          e.printStackTrace();
		        }
		     try {
		       Connection connect = DriverManager.getConnection(
		              "jdbc:mysql://172.16.63.135/test","root","000000");
		       Statement statement=connect.createStatement();
		       
		       if(!statement.execute(creatsql))
		         {
		             System.out.println("成功创建表！");
		         }
		         else
		         {
		             System.out.println("创建表失败！");
		         }
		         //
		       statement.close();
		          connect.close();
		       
		       
		  } 
		     
		     catch(SQLException e)
			   {
		    	 e.printStackTrace();
		    	 System.out.println("创建表失败！");
			   }
		 }

	

}
